﻿<UserControl
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid" 
    xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core" 
    xmlns:local="clr-namespace:Views" 
    dx:ThemeManager.ThemeName="MetropolisLight" 
    x:Class="Views.DataTableView" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <dxg:GridControl x:Name="grid" 
                         AutoPopulateColumns="True" 
                         local:GridItemSourceDp.BindableSource="{Binding DisplayData}" 
                         Visibility="{Binding CardViewVisibility}">
            <dxg:GridControl.DetailDescriptor>
                <dxg:DataControlDetailDescriptor 
                    ItemsSourceBinding="{Binding SubData}" >
                    <dxg:GridControl AutoPopulateColumns="True" ></dxg:GridControl>
                </dxg:DataControlDetailDescriptor>
            </dxg:GridControl.DetailDescriptor>
        </dxg:GridControl>

        <dxg:GridControl Name="gridControl1" 
                         AutoGenerateColumns="AddNew"  
                         Visibility="{Binding TableViewVisibility}"
                         EnableSmartColumnsGeneration="True" 
                         SelectionMode="Row" 
                         ItemsSource="{Binding DisplayData}" 
                         >
            <dxg:GridControl.View>
                <dxg:TreeListView Name="treeListView1" 
                                  AllowPerPixelScrolling="True" ShowTotalSummary="True"/>
            </dxg:GridControl.View>
        </dxg:GridControl>
    </Grid>
</UserControl>
